\chapter{Vector Functions}


%%-------------------------------------------------------------------------%%
%%--- Vector functions and space curves -----------------------------------%%

\section{Vector functions and space curves}

Up to this point, we have extensively studied functions that take a real
number and return another real number. In other words, the functions
we have considered so far are mostly of the form $f : \mathbb{R}
\longrightarrow \mathbb{R}$ whose domain and codomain are both the set
of real numbers. The definition of a function is rather
straightforward: a function $f : A \longrightarrow B$ from a set $A$
to a set $B$ is a rule that assigns to each element in its domain $A$
exactly one element in its codomain $B$. Nothing in this definition
restricts us to only consider the real numbers. Indeed, it is possible
to have the real numbers as the domain and the set of all two- or
three-dimensional vectors as the codomain. This is precisely what
\textbf{vector functions} are about: assigning a real number to a vector.

Any two-dimensional vector $\textbf{u} = \langle u_1, u_2 \rangle$ can
be considered as an ordered pair $(u_1, u_2)$ of real numbers. The set of
all ordered pairs of real numbers is denoted
\[
\mathbb{R}^2
=
\mathbb{R} \times \mathbb{R}
=
\left\{
\left. (a,b) \, \right| \,
a,b \in \mathbb{R}
\right\}
\]
Similarly, any three-dimensional vector $\textbf{v} = \langle v_1,
v_2, v_3 \rangle$ can be represented as an ordered triple $(a,b,c)$ of
real numbers. And the set of all ordered triples of real numbers is
denoted
\[
\mathbb{R}^3
=
\mathbb{R} \times \mathbb{R} \times \mathbb{R}
=
\left\{
\left. (a,b,c) \, \right| \,
a,b,c \in \mathbb{R}
\right\}
\]
The upshot is that these notations allow us to conveniently talk about
a general vector function, without being tied to any specific rule for
assigning a real number to a vector. For instance, if our codomain is
the set of two-dimensional vectors, we can simply describe a vector
function as $f : \mathbb{R} \longrightarrow \mathbb{R}^2$. When the
codomain in question is the set of three-dimensional vectors, we can
decribe a vector function as $f : \mathbb{R} \longrightarrow
\mathbb{R}^3$. Thus vector functions in the $x$-$y$ plane and in
three-space are $f : \mathbb{R} \longrightarrow \mathbb{R}^2$ and $f :
\mathbb{R} \longrightarrow \mathbb{R}^3$, respectively.

A vector function $f : \mathbb{R} \longrightarrow \mathbb{R}^2$ in the
$x$-$y$ plane can be expressed in the form
\[
\textbf{r} (t)
= \langle x(t),\, y(t) \rangle
= x(t)\textbf{i} + y(t)\textbf{j}
\]
where $x(t)$ and $y(t)$ are functions that map real numbers to real
numbers. Similarly, a vector function $f : \mathbb{R} \longrightarrow
\mathbb{R}^3$ in three-space can be written as
\[
\textbf{r} (t)
= \langle x(t),\, y(t),\, z(t) \rangle
= x(t)\textbf{i} + y(t)\textbf{j} + z(t)\textbf{k}
\]
where $x(t)$, $y(t)$ and $z(t)$ are also functions that assign real
numbers to real numbers. Just as $u_1, u_2, u_2$ are components of the
vector $\textbf{u} = \langle u_1, u_2, u_2 \rangle$, we also refer to
$x(t),\, y(t),\, z(t)$ as being \textbf{component functions}. We now
consider examples of vector functions and their graphs.

\begin{example}
\label{eg:unit_circle_vector_function}
Sketch the graph of the vector function
\[
\emph{\textbf{r}} (t)
= (\cos t)\emph{\textbf{i}} + (\sin t)\emph{\textbf{j}}
\]
for $0 \leq t \leq 2\pi$.
\end{example}

\begin{proof}[Solution]
The graph of $\textbf{r}(t)$ is the graph of the parametric equations
$x = \cos t$ and $y = \sin t$ where the parameter $t$ is bounded by $0
\leq t \leq 2\pi$. As $t$ increases from $0$ to $2\pi$, the vector
$\textbf{r}(t) = \langle \cos t,\, \sin t \rangle$ traces out the unit
circle whose center is the origin $(0,0)$ of the $x$-$y$ plane. The
graph of $\textbf{r}(t)$ is shown in
Figure~\ref{fig:unit_circle_parametric}.
\end{proof}

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% the rectangular axes
\draw[->,>=stealth,semithick] (-1.8,0) -- (2,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-1.8) -- (0,2) node[above]{$y$};
% parametric unit circle
\draw[domain=-3.141:3.141,smooth,color=blue]
plot[parametric,id=parametric-circle] function{1.5*sin(t), 1.5*cos(t)};
\draw[->,>=stealth,very thick] (0,0) -- node[above]{$\textbf{r} (t)$} (1.3,0.76);
\draw[->,>=stealth] (0.7,0) arc (0:50:0.4);
\node at (0.9,0.2) {$t$};
\end{tikzpicture}
\caption{The unit circle as the vector function $\textbf{r}(t) =
  (\cos t)\textbf{i} + (\sin t)\textbf{j}$.}
\label{fig:unit_circle_parametric}
\end{figure}

\begin{example}
Use \sage to plot the vector function
\begin{equation}
\label{eq:vector_function_epicycloid}
\emph{\textbf{r}}(t)
= (9 \cos t - \cos 9t) \emph{\textbf{i}}
+ (9 \sin t - \sin 9t) \emph{\textbf{j}}
\end{equation}
where $t$ is bounded by the inequality $0 \leq t \leq 2\pi$.
\end{example}

\begin{proof}[Solution]
The vector function $\textbf{r}(t)$ can be expressed as the parametric
equations
\begin{align*}
x &= 9 \cos t - \cos 9t \\
y &= 9 \sin t - \sin 9t
\end{align*}
for $0 \leq t \leq 2\pi$. Using \sage, we can plot these parametric
equations as follows:
\begin{center}
\fontsize{9pt}{9pt}\selectfont
\tt
\begin{lstlisting}
sage: t = var("t")
sage: parametric_plot((9*cos(t)-cos(9*t), 9*sin(t)-sin(9*t)), (t,0,2*pi))
\end{lstlisting}
\end{center}
The result should be a plot similar to that in
Figure~\ref{fig:parametric_epicycloid}. The graph of the vector
function~(\ref{eq:vector_function_epicycloid}) is called the
epicycloid.
\end{proof}

% \begin{figure}[!htbp]
% \centering
% \includegraphics[scale=0.5]{image/parametric-epicycloid.eps}
% \caption{The epicycloid $\textbf{r}(t) = (9 \cos t - \cos 9t)
%   \textbf{i} + (9 \sin t - \sin 9t) \textbf{j}$ for $0 \leq t \leq 2\pi$.}
% \end{figure}

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% the rectangular axes
\draw[->,>=stealth,semithick] (-2.5,0) -- (2.3,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-1.5) -- (0,1.7) node[above]{$y$};
% parametric parabola
\draw[scale=0.2,domain=0:6.2831,smooth,color=blue]
plot[parametric,id=parametric-epicycloid]
function{9*cos(t) - cos(9*t), 6*sin(t) - sin(9*t)};
\end{tikzpicture}
\caption{The epicycloid $\textbf{r}(t) = (9 \cos t - \cos 9t)
  \textbf{i} + (9 \sin t - \sin 9t) \textbf{j}$ where the parameter
  $t$ is bounded by $0 \leq t \leq 2\pi$.}
\label{fig:parametric_epicycloid}
\end{figure}

\begin{practice}
Plot the following vector functions:
\begin{enumerate}
\item The parabola: $\emph{\textbf{r}}(t) = t^2 \emph{\textbf{i}} + t
  \emph{\textbf{j}}$.

% \begin{figure}[!htpb]
% \centering
% \begin{tikzpicture}
% % the rectangular axes
% \draw[->,>=stealth,semithick] (-0.5,0) -- (4.5,0) node[right]{$x$};
% \draw[->,>=stealth,semithick] (0,-2.5) -- (0,2.5) node[above]{$y$};
% % parametric parabola
% \draw[domain=-2:2,smooth,color=red]
% plot[parametric,id=parametric-parabola] function{t*t,t};
% \node at (1,1) [circle,fill=black,inner sep=1.5pt]{};
% \node at (1.5,0.7) {$(t^2, t)$};
% \node at (2,-2) {$t < 0$};
% \node at (2,2) {$t > 0$};
% \end{tikzpicture}
% \caption{The parabola given in parametric form $\textbf{r}(t) =
%   t^2 \textbf{i} + t \textbf{j}$.}
% \label{fig:parametric_parabola}
% \end{figure}

\item The ellipse: $\emph{\textbf{r}}(t) = (2 \cos t) \emph{\textbf{i}}
  + (\sin t) \emph{\textbf{j}}$ for $0 \leq t \leq 2\pi$.

% \begin{figure}[!htpb]
% \centering
% \begin{tikzpicture}
% % the rectangular axes
% \draw[->,>=stealth,semithick] (-2.5,0) -- (2.5,0) node[right]{$x$};
% \draw[->,>=stealth,semithick] (0,-1.5) -- (0,1.5) node[above]{$y$};
% % parametric parabola
% \draw[domain=0:6.2831,smooth,color=red]
% plot[parametric,id=parametric-ellipse] function{2*cos(t), sin(t)};
% \node at (1.0806,0.8414) [circle,fill=black,inner sep=1.5pt]{};
% \node at (2.2,1) {$(2 \cos t,\, \sin t)$};
% \end{tikzpicture}
% \caption{Parametric ellipse $\textbf{r}(t) = (2 \cos t) \textbf{i} +
%   (\sin t) \textbf{j}$ for $0 \leq t \leq 2\pi$.}
% \label{fig:parametric_ellipse}
% \end{figure}

\item The trochoid: $\emph{\textbf{r}}(t) = (2t - \sin t)
  \emph{\textbf{i}} + (2 - \cos t) \emph{\textbf{j}}$ for $0 \leq t
  \leq 5\pi$.

% \begin{figure}[!htpb]
% \centering
% \begin{tikzpicture}
% % the rectangular axes
% \draw[->,>=stealth,semithick] (-0.2,0) -- (6.5,0) node[right]{$x$};
% \draw[->,>=stealth,semithick] (0,-0.2) -- (0,1.4) node[above]{$y$};
% % parametric parabola
% \draw[scale=0.2,domain=0:15.70796,smooth,color=red]
% plot[parametric,id=parametric-trochoid] function{2*t - sin(t), 2 - cos(t)};
% \end{tikzpicture}
% \caption{The trochoid $\textbf{r}(t) = (2t - \sin t) \textbf{i} +
%   (2 - \cos t) \textbf{j}$ for $0 \leq t \leq 5\pi$.}
% \label{fig:parametric_trochoid}
% \end{figure}

\item The deltoid: $\emph{\textbf{r}}(t) = (2 \cos t + \cos 2t)
  \emph{\textbf{i}} + (2 \sin t - \sin 2t) \emph{\textbf{j}}$ for $0
  \leq t \leq 2\pi$.

% \begin{figure}[!htpb]
% \centering
% \begin{tikzpicture}
% % the rectangular axes
% \draw[->,>=stealth,semithick] (-1.5,0) -- (2.5,0) node[right]{$x$};
% \draw[->,>=stealth,semithick] (0,-1.8) -- (0,2) node[above]{$y$};
% % parametric parabola
% \draw[scale=0.6,domain=0:6.2831,smooth,color=red]
% plot[parametric,id=parametric-deltoid]
% function{2*cos(t) + cos(2*t), 2*sin(t) - sin(2*t)};
% \end{tikzpicture}
% \caption{The deltoid $\textbf{r}(t) = (2 \cos t + \cos 2t)
%   \textbf{i} + (2 \sin t - \sin 2t) \textbf{j}$ for $0 \leq t \leq 2\pi$.}
% \label{fig:parametric_deltoid}
% \end{figure}

\item The hypocycloid: $\emph{\textbf{r}}(t) = (8 \cos t + 2 \cos 4t)
  \emph{\textbf{i}} + (8 \sin t - 2 \sin 4t) \emph{\textbf{j}}$ for $0
  \leq t \leq 2\pi$.

% \begin{figure}[!htpb]
% \centering
% \begin{tikzpicture}
% % the rectangular axes
% \draw[->,>=stealth,semithick] (-2,0) -- (2.5,0) node[right]{$x$};
% \draw[->,>=stealth,semithick] (0,-2) -- (0,2.5) node[above]{$y$};
% % parametric parabola
% \draw[scale=0.2,domain=0:6.2831,smooth,color=red]
% plot[parametric,id=hypocycloid]
% function{8*cos(t) + 2*cos(4*t), 8*sin(t) - 2*sin(4*t)};
% \end{tikzpicture}
% \caption{The hypocycloid $\textbf{r}(t) = (8 \cos t + 2 \cos 4t)
%   \textbf{i} + (8 \sin t - 2 \sin 4t) \textbf{j}$ for $0 \leq t \leq 2\pi$.}
% \label{fig:parametric_hypocycloid}
% \end{figure}

\item The hypotrochoid: $\emph{\textbf{r}}(t) = (\cos t + 5 \cos 3t)
  \emph{\textbf{i}} + (6 \cos t - 5 \sin 3t) \emph{\textbf{j}}$ for $0
  \leq t \leq 2\pi$.

% \begin{figure}[!htpb]
% \centering
% \begin{tikzpicture}
% % the rectangular axes
% \draw[->,>=stealth,semithick] (-1.5,0) -- (2,0) node[right]{$x$};
% \draw[->,>=stealth,semithick] (0,-2.4) -- (0,2.5) node[above]{$y$};
% % parametric parabola
% \draw[scale=0.2,domain=0:6.2831,smooth,color=red]
% plot[parametric,id=hypotrochoid]
% function{cos(t) + 5*cos(3*t), 6*cos(t) - 5*sin(3*t)};
% \end{tikzpicture}
% \caption{The hypotrochoid $\textbf{r}(t) = (\cos t + 5 \cos 3t)
%   \textbf{i} + (6 \cos t - 5 \sin 3t) \textbf{j}$ for $0 \leq t \leq 2\pi$.}
% \label{fig:parametric_hypotrochoid}
% \end{figure}
\end{enumerate}
\end{practice}

The vector function in Example~\ref{eg:unit_circle_vector_function}
describes the unit circle in the $x$-$y$ plane. The same vector
function can be extended to three-dimensional space.

\begin{figure}[!htbp]
\centering
\begin{pspicture}(-3.5,-1)(3.25,3)
% coordinate axes
\pstThreeDCoor[Alpha=20,Beta=20,linecolor=black,%
  xMin=-3,xMax=3,yMin=-3,yMax=3,zMin=-0.5,zMax=3]
% outline or frame of the circular cyclinder
\parametricplotThreeD[Alpha=20,Beta=20,xPlotpoints=200,linecolor=blue]%
  (0,628.3185){2 t cos mul 2 t sin mul 2}
\parametricplotThreeD[Alpha=20,Beta=20,xPlotpoints=200,%
  linecolor=blue,linestyle=dashed]%
  (0,628.3185){2 t cos mul 2 t sin mul 0}
% verticle lines
\pstThreeDLine[Alpha=20,Beta=20,%
  linecolor=red,linestyle=dashed,linewidth=0.3pt]%
  (0,2,0)(0,2,2)
\pstThreeDLine[Alpha=20,Beta=20,%
  linecolor=red,linestyle=dashed,linewidth=0.3pt]%
  (0,-2,0)(0,-2,2)
\pstThreeDLine[Alpha=20,Beta=20,%
  linecolor=red,linestyle=dashed,linewidth=0.3pt]%
  (1.860852,-0.732958,0)(1.860852,-0.732958,2)
\pstThreeDLine[Alpha=20,Beta=20,%
  linecolor=red,linestyle=dashed,linewidth=0.3pt]%
  (-1.860852,0.732958,0)(-1.860852,0.732958,2)
\end{pspicture}
\caption{Unit circle in three-space.}
\label{fig:unit_circle_three_D}
\end{figure}

\begin{example}
Sketch a graph of the vector function
\begin{equation}
\label{eq:unit_cirlce_three_D}
\emph{\textbf{r}}(t)
= (\cos t)\emph{\textbf{i}} + (\sin t)\emph{\textbf{j}} + \emph{\textbf{k}}
\end{equation}
\end{example}

\begin{proof}[Solution]
Equation~(\ref{eq:unit_cirlce_three_D}) describes the unit circle
translated by one unit upward in the direction of the $z$
axis. Figure~\ref{fig:unit_circle_three_D} shows a sketch of this unit circle.
\end{proof}

\begin{example}
Describe the vector function
\begin{equation}
\label{eq:circular_helix}
\emph{\textbf{r}}(t)
= (a \cos t) \emph{\textbf{i}} + (a \sin y) \emph{\textbf{j}}
+ (ct) \emph{\textbf{k}}
\end{equation}
with $a$ and $c$ being positive constants.
\end{example}

\begin{proof}[Solution]
Write equation~(\ref{eq:circular_helix}) in the parametric form
\[
x = a \cos t,\qquad
y = a \sin t,\qquad
z = c t
\]
The parametric equations $x = a \cos t$ and $y = a \sin t$ describes a
circle with radius $a$. As $t$ increases, the vector function
$\textbf{r}(t) = (a \cos t)\textbf{i} + (a \sin t)\textbf{j}$
generates points on this circle. Furthermore, as $t$ increases the
parametric equation $z = ct$ increases. The result is a graph of a
circular function that spirals upward as shown in
Figure~\ref{fig:circular_helix}. The figure can also be obtained using
\sage:
\begin{center}
\fontsize{9pt}{9pt}\selectfont
\tt
\begin{lstlisting}
sage: t = var("t")
sage: parametric_plot3d((2*cos(t), 2*sin(t), t/400), (t,0,400))
\end{lstlisting}
\end{center}
which shows a graph similar to that in
Figure~\ref{fig:circular_helix}. This graph is called the circular helix.
\end{proof}

\begin{figure}[!htbp]
\centering
\begin{pspicture}(-3,-1)(3.2,3.2)
% coordinate axes
\pstThreeDCoor[linecolor=black,%
  xMin=-3,xMax=3,yMin=-3,yMax=3,zMin=-0.5,zMax=3.5]
% the circular helix
\parametricplotThreeD[xPlotpoints=200,linecolor=blue,plotstyle=curve]%
  (0,750){2 t cos mul  2 t sin mul  t 300 div}
\end{pspicture}
\caption{Graph of the circular helix.}
\label{fig:circular_helix}
\end{figure}
